Cleaned up some of the WebSocket command code.