Modify escaping sequences...

...according to http://www.json.org/ § string. Single quotation character is not in the list and escape it will raise an error in most browser. No need to handle escaped control characters, since you already escape single back slash.