Stream transform for websocket framing and deframing in pure js