Split out getID() and similar helpers from :xhp:html-element

trait name: can't use ':' in trait names, and xhp_* is effectively reserved for XHP anyway due to the name mangling scheme.