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>.