Better callback streaming posts

My previous pull request had a bug such that the callback would not always get called. This fixes that, adds a better test, and cleans up the code a bit.