AbstractNode replace_child(AbstractNode old, AbstractNode new)
Replaces the first occurrence of the old node child with the new node child. All parent references are updated.
Returns the new child node.