More refactoring and adding tests. Added cache option for file downloader so files can forcibly be redownloaded.