Add batch processing of writing items and ability upgrades to db.