extracted code for downloading file to a separate class FileDownloader. Added tests. Fixed extracting file name from http header.