make sed() support replacement function, fixes #115

* make sed() support replacement function, fixes #115
* added a corresponding test
* updated corresponding document in comment and `README.md`.