More efficient query parsing
handles strings with whitespace (and other special characters)