function dispatchSimpleEvent(target, type, opt_bubbles, opt_cancelable) {
    let e = new Event(type, {
      bubbles: opt_bubbles,
      cancelable: opt_cancelable === undefined || opt_cancelable
    });
    return target.dispatchEvent(e);
  }
Dispatches a simple event on an event target.
@param {!EventTarget} target The event target to dispatch the event on.
@param {string} type The type of the event.
@param {boolean=} opt_bubbles Whether the event bubbles or not.
@param {boolean=} opt_cancelable Whether the default action of the event
    can be prevented. Default is true.
@return {boolean} If any of the listeners called {@code preventDefault}
    during the dispatch this will return false.