add a db base class that sqlite implements
support postgres as a datastore option
change delete_jobs interface for easier testing
add db tests