Close GH-705: Refactor download to util and added retry logic in it.. Fixes #704, Fixes #699, Fixes #700