Refactored database-row classes with superclass to improve error handling and reporting.