Split compiler pass so the listener is defined prior to the event handle...

...r.