Use POSIX compliant functions

"replace" is not a POSIX function and is not available on
*nix. Instances of "replace" have been changed to instances of "sed".
Merge pull request #18 from bugnotme/bugnotme

Use POSIX compliant functions