Optimize from files copied by WPP.

Optimize files copied to PackageTmp directory by WPP, not the original
files in the project. This preserves WPP file inclusion/exclusion rules
(e.g. BuildAction = Content and None).

Additionally, use copied mainConfigFile.

Preferrably we could optimize over existing files (i.e. without copying
first from appDir to dir), but a recent change in r.js prevents it (the
behavior should be restored in the future, see:
https://github.com/jrburke/r.js/issues/479)