Moved config-related into a separate file

This is strictly stripping out config-code into a separate file, nothing else changed.