Switched from default character type functions to ones that use lookup tables. Eliminated the internal state and replaced with in-place iteration of the query. Added code to allow single-lookup detection of normal characters.