add streaming/piping functionality, update tests
Merge branch 'dev'