Fix up some quoting and escape issues, add tags to json