code: function find(doc, element, id) {
    if (!element) {
      element = doc.getElementById(id);
      if (!element) {
        throw new Error('Missing element, id=' + id);
      }
    }
    return element;
  }
docs: Utility to help find an element by id, throwing if it wasn't found