Now handles gzip streams in less memory, and handles plain streams with gzip headers