improved event handling in preparation for replay and history support, beginnings of ui