(#20) Flesh out rewrite daemon.

- Add pcre_replace() to do substring replacement, takes a string containing
  optional \N sequences which are replaced with captured substrings.