Reorder config validation

The check for project name was after the first usage of it.
This moves the validation before the usage.
Clean up config validation

Config validation was unnecessarily complex and difficult
to follow. This clears things up a bit.