fixes handling  networking errors and retries. Adds  tests
add .bind
Merge pull request #870 from matiu/bug/handlerNetErrors

Bug/handler net errors