4f470b9231
The correct sequence of actions should be remove(old) → insert(new), not insert(new) → remove(old). We can implement a simple delegate insertion functions to insert the new child between the previous and next siblings of the old child. While we're at it, let's also add a unit test for replace_child().