fix a mis-named query builder, add more exception builders, finish the
initial implementation of the directory query parsing code.