PHP 5.4 Compatibility: rewrite preg_replace e-modifier

The e-modifier in preg_replace is deprecated in PHP 5.4 / 5.5. This modification rewrites existing calls to preg_replace with the e-modifier to preg_replace_callback.