Added new DownloadBuffer class and made rest of the code use it.