Refactor
Refs #1128 - only add project.target when main.target does not exist
Refs #1128 - try to use (sensible) default name when project name is not set