Refactor syntax unicode with shims

The branch is currently broken in much more places compared to refactor-syntax_unicode.
It should probably be merged in refactor-syntax_unicode when it's more stable.