Refactors assets to use requirejs

Moves all modules to a module directory. Moves page endpoint scripts to
routes directory. Moves vendor libraries to lib directory.