Changing .on to .map.  Making app a constructor function.