Optimization (no cloning) and refactoring of MfencedReplacer.