Initial version of MigrationOptimizer and tests