New transcoder that supports multi-character replacements.

Fixes #870.
Cleanup.