fix comments/spacing and pass reference to string
handle trailers and final CRLF if chunked