Added a filter to automatically write the environment before application.js. Added Assetfile to guard.