Refactor database access classes into their own package.