Added tests for migrations.
Refactored Temporary Folder Creation.