Fix circular dependencies
Use copy instead of deepcopy for parse_ref cache; activity collapsing refinements