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