Prune the query API down to a consistent set of commands and adjust tests.