Implemented WebSockets and new event system