(WIP) Events

Todo:
- [x] Read events from the user command response
- [x] Read events from the message stream
- [x] Make a loop to do longpolling/shortpolling
- [x] Replace std:cerr by exceptions
- [x] mutex
Taken from here: https://github.com/Wizcorp/mage/blob/7c19bcad1c09622ce1efdebe20417478212b0801/lib/msgServer/transports/http-shortpolling/client.js#L17

Doc incoming.