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

https://bugzilla.mozilla.org/show_bug.cgi?id=987487
There is many leftover commented code here.

Also, the type attribute of these <script> elements is never set.
On master, the aggregated <script> element has by default type=application/javascript,
or the specific value used by the app's html file.
With your patch it looks like there is never type attribute being set.