models/search: Don't create empty queries
Implement true tree-like querying DSL
Add test coverage for query