deduplicate database loading (hacky WIP)
unlink_pkg_files should print DELETING
remove more duplication and dead code