improved events

Assign more state to session and use event emitter pattern to inform
other components.