Added a Database::getTotalChanges() method and unit test