fix #250, refactor stream replay api and impl
Merge pull request #251 from manuzhang/refactor_stream_replay_api_impl

fix #250, refactor stream replay api and impl