Wip/events

could you take a look at the four latest commits? some tests are missing, but code should be in a good state.