fixed recursive event handler invocation

also refactored the EventStream/EventDispatcher code