optimized recreate_object_graph so that it creates a mapping from atom labels to atoms once at the beginning instead of searching the list every time it needs to find an atom corresponding to a label