Move Element::get_attr to a trait defined in util::tree

… and add a get_local_name() method to that trait.