extract init config file into a variable
Merge pull request #626 from pmenglund/master

extract init config file into a variable
Refactor around channels instead of locks.

This does not fully work yet and I'm not sure why.

But...

* For me, it's easier to follow.
* removes explicit locks
* implements retry logic (AFAICT, missing from the old client).
Other?
This fixes the test that I saw hanging
benchmark stuff
Debug
ATM reconnect as needed, but only with a single go routing at a time

Also, use sync.Once to ensure that the connect logic is only called
once. This is currently a race in the mainline client.
Don't use sleep, wait for the reconnect doing the work to finish
correct location