Generalised a lot of the functions here to take an isomorphism as an argument.
Managed to get last_leq-ins fusing to True correctly, but I had to disable the check for fixes being contained within facts before fix-fact fusion. Now I have to figure out how to stop sorted_tree looping without this check.