Cleaned up handling of Cordova resume/resign and online/offline