As preparation for #37344, let's split out iterator.h so we can avoid including the entirety of hashmap.h where it's not needed.