def add_listener(type, once=false, &callback)
      listener = Listener.new(type, callback, once)
      listeners[type] ||= []
      listeners[type] << listener
      emit(:new_listener, self, type, once, callback)
      listener
    end
def add_listener(type, once=false, &callback)
      listener = Listener.new(type, callback, once)
      listeners[type] ||= []
      listeners[type] << listener
      emit(:new_listener, self, type, once, callback)
      listener
    end
Register the given block to be called when the events of type +type+ will be emitted.
 if +once+, the block will be called once