Massive refactor to follow some reasonable guidelines of breaking up a NodeJS application.

This should make testing a lot easier, as everything is much more broken up.