Much more refactoring

* Moved script logic into objects
* Improved I/O cohesion
* Improved generality/symmetry in conversion functions
* Reorganized module structure
Merge pull request #7 from jonnystorm/more_refactoring

Much more refactoring