DB related stuff refactored into its own library, breaks API.