Encode non-ascii chars in JS strings with unicode literals

For #327