Significant JavaScript WebSocket improvements