WIP: clean up websocket handling and messaging