Make WebSocket codec also work when HttpClientCodec and HttpServerCodec is used.

Also refactor the handshakers to share more code and make it easier to implement a new one and less error-prone