Lots of cleanup, testing, docblocks, and refactoring
Finishing unit tests