Made change to events.js to improve the reliabilty of external systems tracking listeners, and ensure that an event is not called after it has been formally removed as a listener.