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