Replaced deprecated preg_replace /e flag with preg_replace_callback

I finally got around to look into the bug warning messages I mentioned in #59. This commit fixes it by replacing the `preg_replace()` calls with `preg_replace_callback()` which is the recommended way, according to the documentation:
http://php.net/manual/en/reference.pcre.pattern.modifiers.php#reference.pcre.pattern.modifiers.eval