Added tests to ensure copied references are consistent

Ensure that references within a copied set remain consistent.

i.e. if a node with a set references another node within the set, then the reference in the new set should not reference the old set.