Adds support for persistent http connections

Not sure about two points:
- Timeout after 30 seconds, otherwise connection will stay open forever?
- Connection cleanup in on_close?