Initial web socket API.

This PR is to a `websocket` feature branch for later merging into `master`.
Does the protocol differentiate between text and binary?