General refactoring

Separated web/server code. Everything in the "web" directory will get
placed on the web server (client-side code), and everything in "server"
is solely for the backend server.