Initial web socket API.

This PR is to a `websocket` feature branch for later merging into `master`.
Not sure what to do here. I want a blocking API but this can't be on the thread that's actually reading the socket because control frames can come between partial payload frames. That said, there can only be one payload at a time so it's not like there are a bunch of threads here, just one callback thread which != socket reader thread.