Updates all AMD/requirejs stuff to CJS/browserify modules.

This allows the removal of a couple of frontend dependencies, with the remaining installable via npm.

Other enhancements include:

 - Refactoring across the board.
 - Much improved README.
 - Better backend logging.