Remove layerEventHandlers object

Storing the event handlers in an object was causing a bug.