(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
Again, I don't care, I was just curious :)
Either works, and the differences between the two are too small to waste a lot of time on. Go with what you prefer.