Check that uploaded APKs are a proper update to current app

Merged username-removed-26331 requested to merge grote/repomaker:107-app-updates into master

Also refactor the messy upload code and add lots of tests

Closes #107 (closed)