Replaced RawException usage with MigrationException in Migrator::migrateDown(). Added NULL checks for global $config and $db in DBTestCase.