fix minor bugs
fix multiple issues

- reconnect support for tcp
- reusing connections
- fix several bugs
- shutdown helper