Overhauled the download function to take one of four data formats.