Add .rebar directory to .gitignore
Fix some problems:
- some data was not correctly split on newlines, causing failure of json parsing.
- handle extra error conditions, slower reconnect or no reconnect on those conditions.
- if stopping the stream, wait for it to be stopped before restarting.