Add option $mode for encode_js_string to produce single-quoted and single-quoted inside double-quoted string