Add query typespec DSL and query API

Simplifies validator type checker and smart escaper.
Adds the ability to document query operators and functions.
Prepares for query functions.