Use #gsub with block

because replacement string may contain special characters
Merge pull request #64 from alphagov/safe-string-replacement

Implementation of string replace without regex