Handle errors in RPCs and optional websocket subprotocol

I split the commits in case you want to cherry-pick!

The subprotocol option change is to allow greater flexibility. For example, a server that runs wamp over SockJS understands wamp correctly, but has no subprotocol handshaking for the time being.