Adding  method for trees. When this is run, it creates a dictionary mapping node labels to tree nodes. After being run, all find_elements searches for named labels will be much faster.