Fix an issue caused by setting 'window.ENV' at the wrong point

Setting `window.ENV` after `app.js` is causing issues.