Escape dollar signs ('$') in replacement strings.

Fixes #242.

`String.prototype.replace` treats '$' as a special character,
so replacement values with substrings like '$&' will break.

See <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_string_as_a_parameter>.
Merge pull request #243 from slashgrin/issue_242_regex_replacement_escape

Escape dollar signs ('$') in replacement strings.