Extract query Visitor interface to its own file
Avoid some wrong completions on autocomplete

As long as the query parser is not able to parse the whole grammar,
there's not much more we can do, as we want autocompletion for queries
the parser still can't understand.