Config: switch from foreach iterator

An iterator is much more natural in python, so let's use that.
Merge remote-tracking branch 'carlos/config-iterator'