Start implementing support for downloading of test decks

The work here was mainly merging together my branch with the one of @aagbsn and
refactoring a lot of the code.