Consolidates event listener code

Consolidates event listener code into a module that can be shared
across modules that broadcast events that can be observed.