JavaScript computing Unicode categories