Extract WaitForStream function

The wait code from the example app is quite helpful. This give users of
the library an opportunity to leverage it without duplication.

* Extract WaitForStream function

Minor changes:

* Add short-circuit on CreateStream so it returns if it already exists
* Move the Get records to bottom so it fetches all the records
* Update the batch put so the records are distinguishable from single puts