Refactor.  Kill useless crap and split big messy files.
Merge branch 'utils-refactor-1' of github.com:medthehatta/thesis-code into utils-refactor-1