Breaking up query() function in viewtools, to simplify code en-route to
a division of work for SVG generation.