Reverse optimize/generate order

Generator has to be run before compiled.php is created.