Do not crash on malformed json message on websocket.
Add comms tests.
Merge pull request #298 from hindessm/test-comms

Add comms tests