Offline app download for remote apps

http://manage.dimagi.com/default.asp?149434
I think ideally create_all_files would have a predictable return type and you wouldn't need to make that check here, but I'm ok if the answer's that that's too deep somewhere