Basic websocket connection support

OK, the cleaned up (rebased) PR for basic websocket connection support.  Requesting review from @tOkeshu, as I believe he both knows the code being touched and has already looked at the patch somewhat anyway.