Implemented databases for peercache and friendsync, modified
select_and_fix such that it will only select packets which are matching
friends.