(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
Cute, but there's not a single C++11 compiler that doesn't support it, is there? Oh well, not gonna argue over this one, was just curious.