docs: function() {
  
      this.on = this.addEventListener = function(type, listener) {
          if (!this.events[type]) {
              this.events[type] = [];
          }
  
          this.events[type].push(listener);
      };
  
      this.off = this.removeEventListener = function (type, listener) {
          if (!!this.events[type]) {
              for(var i = 0; i < this.events[type].length; i++) {
                  if (this.events[type][i] === listener) {
                      this.events[type][i] = null;
                      this.events[type].splice(i, 1);
                      return;
                  }
              }
          }
      };
  
      this.removeAllListeners = function (type) {
          this.events[type] = [];
      };
  
      var emit = function(cb, event) {
          // Handle callbacks asynchronously
          setTimeout(function() {
              cb(event);
          }, 0);
  
      };
  
      this.dispatchEvent = function (event) {
          if (!!event.type) {
              var type = event.type;
              if (!!this.events[type]) {
                  event.target = this;
                  for (var i = 0; i < this.events[type].length && (event.returnValue === undefined || event.returnValue) ; i++) {
                      var cb = this.events[type][i];
                      // Dereference cb for async
                      emit(cb.bind(event.target), event);
                  }
              }
          }
      };
  }