Merge pull request #12 from Robert-Nelson/chunk-support

Add chunked transfer support and retry after malformed responses

Fixes issues #9, #10, #11 and #12