Move `test_migrations` from Nova.

Added class WalkVersionsMixin with common methods for migration tests
(`_migrate_up()`, `_migrate_down()` and `_walk_versions()`).
Tests added.

blueprint test-migrations

Change-Id: I6689c7a01bba7a146ac402a1fe72768a29c72161
Merge "Move `test_migrations` from Nova."