Use JSONEncoder to escape JSON strings.

This CL fixes escaping of '\n' and unicode characters.

BUG=grit-i18n:20

Landing for alexeypa@chromium.org, patch from issue 18301005.

Review URL: https://codereview.chromium.org/18860003

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@129 7262f16d-afe8-6277-6482-052fa10e57b1