undelegateListeners now supports optional listeners
add comprehensive testing for delegateListeers and undelegateListeners custom listener argument.