Move some code into config_utils, and more cleanup of config_parse.