MODE-2276 Replaced the old logic to find child node definitions with the new logic

All of the places where the old logic was being used, including in the session's
pre-save (validation), have been replaced with the newer logic added in the previous
commit. I extracted the `SiblingCounter` nested interface (added in the previous
commit) into a separate abstract class with static methods to create commonly-used
implementations. The old logic has been removed.