Initial fix-up commit

* Corrects module structure
* Isolates all functionality into classes
* Switches (mostly) to dependency injection architecture
* PEP8 compliance