Move file generation to Mira.  Conditionally adds start wrapper if program contains main.