Added event handling by type and basic websocket chat support