reimplement streams and change API
Merge pull request #1 from fardog/stream-refactor

reimplement streams and change API