Replace recursive tree walks in the export template (sortChildren, mapNodes, markActive) with iterative traversals, and build getPath with push + reverse. closes #11225