Adding classes for download and dataset objects

That was the main purpose here.  I also cleaned up some data structures.  This will likely cause downstream problems for users, but I'm trying to clean up for publication.