Require destinations when they are needed and do not fetch all of them in advance

Fixes #5266.
You can remove the `root` parameter: add `kidsOrNames` (= `this.root`) and iterate "by levels" if the 'Kids' are present (e.g. `while (kidsOrNames.has('Kids')) {`) .

It will be also useful to track and limit the recursion depth, e.g. by max amount of iterations or record all visited nodes.