refactor($parse): reduce code size used by unicode handling

Reduce code size from 98384 bytes (37939 bytes gzipped) to
96361 bytes (36919 bytes gzipped), which is about 2k bytes
(~1.6k gzipped).