assist #11091: refactor server DB queries for hierarchy navigation

Fixes step one of http://trac.openmicroscopy.org.uk/ome/ticket/11091 and prepares the way for http://trac.openmicroscopy.org.uk/ome/ticket/11019. Batches bulk DB queries for hierarchy navigation and has preprocessor and container service use the same query code.

To test, check for regressions in behavior that relies on graph traversal, including fileset splitting.