relabelWithFreshIds

Relabels the tree with new nodeIds using a shared atomic incrementer. Returns a new tree with the same structure and data, but fresh nodeIds.