New methods for working with permutations

Can now:
- set items (``perm[2] = 3``)
- iterate over pairs ``x, f[x]``
- invert and compose permutations
Fixed a bug in remove_from_domain
Fixes and QoL updates for Trees

Can compare trees with == and !=
Moving the random trees script into trees.py
Fixes to the way BinaryTree.leaves() uses permutations
Fixing the TreePair.reduce()

The previous two commits seem to be enough to make it work properly now.
(Famous last words...)