refactor various pieces of query2 ns, add dfs path query fns & new helpers (incl. graphviz dot generator)