Allow rollbacks of migrations
Some refactorings and movings