make sed() support replacement function, fixes #115

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