Implement Migration Service, add test code