Refactor client-side scripts

* Individual pages/views loaded dynamically by 'page' module
* Widget view moved to default page rather than main
* Added login page, currently not functional
* Redirect automatically to login page when auth fails