Fix some tabs in the code
Use wide character function for categorizing codepoints

Previously we used the is... rather than isw...
These functions were not supporting non ascii characters correctly