Abstracted how migration state is saved and loaded.
This should make it possible to store migration state to different storage engines.
Fixed bug caused by running migration down twice in a row.