MODE-2276 Changed how child node definitions are found when adding a child

The new logic attempts to limit the need to find the number of existing children
with the same name as the proposed child, and it provides reusable components
that will improve efficiency when using a single session to adding lots of
children under the same parent.