Config: switch from foreach iterator

An iterator is much more natural in python, so let's use that.

---

I documented what we return in `docs/config.rst`, but I'm not sure if there's a better place/way.

With this, we're removing the last usage of a foreach, so we should be able to close #183.