CB-6440 Move config logic to its own module
CB-6522 Disallow space in target name

- Update target add command
- Update auto-detected target