Since we are wrapped in a closure, no need to make a single global variable
Loaded resource twice
Removed global app and replaced with individual vars.  Safe since wrapped inside an anonymous function
Removed some spaces.  made more explicit the whenReady function since it wasn't clear they were connected and could easily be broken by inserting code in between.