afs: Overhaul cell database management