Create message storing middleware that stores messages in conversation and router batches.

This is part of #278.