websocket implementation

TODO: think about having one app. it is a little gross that so much code
is duplicated between the projects.