WIP modules, foreign modules, and js output optimization