Initial web socket API.

This PR is to a `websocket` feature branch for later merging into `master`.
Question: do I have to consume the entire payload?