Move options parsing before config_file access

The option to specify an alternative config file is part of the
command line options. These must be parsed before option values can be
used. This never worked before.
Read credentials from environment