Move functions for auto-update to where they should be.

I.e. not in appMain.