added chunked upload resume feature
refactored some chukload code, to make it DRYer