Move the code for decoding gzipped streams into load_from_stream() so that all streaming code can use it.