Rework websocket handler to track state
Rework Cowboy bridge to support websocket state