Move factories from module.config.php to Module.php

move factories to Module.php so that when we have ('config_cache_enabled' => true) then we will not face merged config errors from the functions