Replace leading underscores in tokens. The datastore doesn't allow primary keys that start with underscores. IN MASTER
Revert "Rewrite parse_terms now we don't have complication of special-casing quoted query strings"

This reverts commit 892520e4d32ce58c3d03e323d4f928508d062230.
Canonicalize quoted strings as well as unquoted ones.