Quick fix for issue 51 - error when downloading empty files

I moved the upload / download logging logic into a separate method and added a unit test. It no longer fails when downloading an empty file, but does log the same warning twice -- pls let me know if this needs to be fixed.

(Would have added a functional test, but I'm having trouble getting the required version of Vagrant to work on my machine.)