Necessary infrastructure change so that we can find parent pids while iterating over tree.
Refactored to use new batch-iterator module.