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
I don't like std::cout/err making ther way in the lib, we should do proper programatic error management instead (throw or something else)