Add facets and query validator to query builder.

Fixes #14