Bug 987487 - [Gaia] [Build] Refactoring webapp-optimize.js and unit tests

https://bugzilla.mozilla.org/show_bug.cgi?id=987487
What about setting `defer: true` in `deferred` definition instead?