Leftovers from old caching method.
Added a "hooks" system. Thanks to Jon Hobbs.

https://gist.github.com/johdax/1130336
Cordova tweaks. Need to figure out why it is running the code twice. I think it is from the ajax but not sure.
Changed environment back to cordova.