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

I'm trusting that nothing in here changed and it was just moved...  it'd be nice to move and change in separate commits next time.