Major revisions, lots of almost-pointless refactoring
minor changes to makefile