Temporarily reverted to JSON all data for WebSockets.
Added error handling so it doesn't take down the server upon failure.
Added a try-catch for additional safety.
Merge pull request #40 from kaisellgren/master

Stability improvements