Adjust query for implicit root.

Slight update to the adjustments to a query with an implicit root. If we
have a predicate we prepend slash and dot, otherwise we prepend just a
slash.
Merge branch `sub-queries` into `master`.