Reorder setup script and create base app/tmp directory