Initial web socket API.

This PR is to a `websocket` feature branch for later merging into `master`.
Perhaps sending a message should also take a PayloadType ? That way symmetry.