Set timeouts on ws calls

...or on ajax requests via the usual timeout.
The errorCb should be called with a well formed jsonrpc error object, as in line 145/149.  Hmm, looking closer at 145, it's not correct either :P

The error callback should contain code and message, optionally data.  In this case I would suggest using code 504 (inspired from HTTP) and giving the actual timeout in data, if not more info about which call that timed out:

    {
      "code": 504,
      "message": "Request timed out",
      "data": {
        "timeout": 5
      }
    }