[cleanup] Use range for instead of std::for_each
This commit replaces all use cases of std::for_each(..., std::mem_fn(...)) by a much more readble plain range for. It does not replace other uses, where this may be more controversial.
This is a follow up to !115 (merged).