MDL-57919 mod_data: Refactor and new method get_configs_for_external