Fix #111 and #112

JSON escaping and unescaping is now much more solid, and we do it in the
right places. More escapes can be added later, if needed.