Configurable stream client.

* CheckReconnect callback in the style of http.Client CheckRedirect.
* State machine replaces recursion.
* Common (Re)connect error handling.
Repository example was kinda racey.

Example repository test was dependent on http connection speed. For
better or worse Subscribe doesn't wait for an initial connection (or
failure) before returning anymore. Perhaps I should add a state so
you can wait if you like.