Add better streaming api and fix timeout / chunk size bug

@vsivsi