Removal of config.Config from ref package
As we are ready to get rid of the global config.Config variable this change does exact it for the files in the ref package. It also includes some small refactoring like adding a setup functions, etc.
Part of: #2699 (closed)