Remove ITEM_INDEX macro
Replace gitem_t with bg_iteminfo_t and fix some whitespace