Added a number of error checks and recovery steps to allow safe invocation of cronRefreshModuleStore.sh, which pulls an extract from the module store on S3.