Encode strings with utf8.js to support multibyte strings

Also makes emojis work.

The downside is that utf8.js will be some 200 more lines of code, but I think it's worth it.