Dispatch the flags query if it's the only one.

ie, we got something like FETCH 1:* (FLAGS)
but not for FETCH 1:* (FLAGS INTERNALDATE)
patch UIDVALIDITY response for conformance to the spec

testimap was choking on this.
reset last uid on expunge
fix internaldate storage
factor out bound and filter for msg seqs
Fix grave bug with iteration in STORE

This was in the root for problems with Trash behavior. Closes: #4958
Make use of the refactored utilities for bounding and filtering
sequences.
Temporal refactor setting of recent flag.

This flag is set way too often, and is damaging performance.
Will move it to a single doc per mailbox in subsequente commits.
Merge remote-tracking branch 'refs/remotes/kali/bug/fix-store-iteration' into develop