Refactor Database. Implement Database::getTuples.