Escaping characters to match JSON spec.
python str encode method results in single quotes somehow.
Better perf with set, escape in-line, always unicode.
Comment explaining in-line instead of function
Fix newline and control escaping for JSON.