Improving event based control, plus couple of other low level improvements. Related to #42, #37 and #36.