Refactor into separate files for unit testing
Add unit testers for each of the pieces
Reorg