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.
The returned value is NOT the current node.
Returns the new child node.