Unique address tracking indexes for message store models

The message store models need indexes similar to the ones added in #864 but with the to/from addresses included.
Migration methods operate on a temporary `MigrationData` object which stores new and old versions separately. Changes are only applied to the model data after the migration method returns successfully.