support postgres as a datastore option
change delete_jobs interface for easier testing
add db tests