refactored migrate.js, added test skeleton