Merge pull request #89 from DrMarcII/master

Lots of cleanup and new features.