Many changes to websocket engine architecture