Detect appLaunch and app terminate
Merge branch 'master' of https://github.com/claytronics/phonegap