Fixed a bunch of errors with socket.io. Cleaned up the client-side js a little bit.
Merge branch 'working'