Massive refactoring of code to clean everything up

Closes #1 
Closes #7