Simplified EventDispatcher listeners logic

EventDispatcher listener logic has been simplified and improved. Now
there’s a single list of listeners that handles both method and
functions (at the cost of an extra ‘type’ call on dispatch iteration).
with the pros of a single predefined sorting logic based on
registration order.