Extract filtering/sorting of messages into folder class so we can use it for thread delete and other stuff.
Delete whole threads in a single bound