Initial web socket API.

This PR is to a `websocket` feature branch for later merging into `master`.
Gotcha. In that case I think `Callback` is the wrong word. Maybe receiver, handler or listener ?