Fix bugs in migration system

Migration system for flatfile now works 100%

UUID support still untested; should work in theory.