Use python's json lib to output strings - it handle's encodings so we don't have to. It also
outputs the quotation marks around the strings, so remove them from the template.