ESDEV-1531 Refactoring dbMaintenance class, how database is restored after tests run. Fix for tables without id