function EventHandler() {
    var handlers = [];

    this.subscribe = function (event, handler) {
      handlers.push({
        event: event,
        handler: handler
      });
      event.subscribe(handler);

      return this;  // allow chaining
    };

    this.unsubscribe = function (event, handler) {
      var i = handlers.length;
      while (i--) {
        if (handlers[i].event === event &&
            handlers[i].handler === handler) {
          handlers.splice(i, 1);
          event.unsubscribe(handler);
          return;
        }
      }

      return this;  // allow chaining
    };

    this.unsubscribeAll = function () {
      var i = handlers.length;
      while (i--) {
        handlers[i].event.unsubscribe(handlers[i].handler);
      }
      handlers = [];

      return this;  // allow chaining
    }
  }
Fires an event notifying all subscribers.
@method notify
@param args {Object} Additional data object to be passed to all handlers.
@param e {EventData}
     Optional.
     An <code>EventData</code> object to be passed to all handlers.
     For DOM events, an existing W3C/jQuery event object can be passed in.
@param scope {Object}
     Optional.
     The scope ("this") within which the handler will be executed.
     If not specified, the scope will be set to the <code>Event</code> instance.