Try lazy loading messages for Iterate().

Prior to this, iterating through the messages in a store would cause
them to always be read and parsed even if we didn't need them (e.g. if a
key hadn't expired/didn't need to be flushed).

This approach is simple but ugly: a function is passed that can retrieve
the messages when needed, rather than passing the messages themselves.