replace quotes globally.

Quoted strings are handled wrong. This fixes the issue.

>>> "asd \"is\" not \"asd\"".replace(/"/, '\\"');
"asd \"is" not "asd""
>>> "asd \"is\" not \"asd\"".replace(/"/g, '\\"');
"asd \"is\" not \"asd\""