websockets: Return JSON in all cases

We return a json object which always contains a status, and optionally
contains a result. The type of the result varies.
Merge pull request #55 from cmaloney/json_response

websockets: Return JSON in all cases