Correctly parse out longer operators

When longer operators containing substrings which matched other operators of
a higher precedence then the query tokenizer was extracting the other
operator. The tokenizer now prioritises parsing out the longest-possible
operator in the query.