Replaces sbt AJAX calls with web socket. Also some refactoring of code.

I'm assuming splitting the commits now is pretty painful, so next time unless you think you can do it easily.