config: ensure that options like `--debug` are set first
config: ensure that options like `--debug` are set first

`spack --debug config edit` was not working properly -- it would not do show a
stack trace for configuration errors.

- [x] Rework `_main()` and add some notes for maintainers on where things need
      to go for configuration to work properly.
- [x] Move config setup to *after* command-line parsing is done.

Co-authored-by: scheibelp <ea71b66c00d5c909176e1aa644b5045a92794a6c@llnl.gov>

LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack