Scaffolding and general refactoring of code base.

Proper scaffolding and general refactoring in preparation for extending the functionality of the program