Avoid unnecessary juggling of messages by factoring out the useful bits of ConversationWrapper.collect_messages().