function getRootElement (el) {
  while (el.parentElement) {
    if (el.tagName === 'BODY' || !el.parentElement) {
      return el
    }
    el = el.parentElement
  }
  return el
}
Retrieve the nearest 'body' ancestor of the given element or else the root
element of the document in which stands the given element.

This is necessary if you want to attach the events handler to the correct
element and be able to dispatch events in document fragments such as
Shadow DOM.

@param  {HTMLElement} el The element on which we will render an app.
@return {HTMLElement}    The root element on which we will attach the events
                         handler.