restructured event handling messages and syntax. use .when for
responding to stream events (previously known as stream notifications)