Replaces level with given index with new level/child.
Replaces first instance of given level/child with new level/child.