Quote all \ and ", not just the first

Use 'g' flag for replace() regex.
Merge pull request #2 from pysquared/master

Quote all \ and ", not just the first