Implemented ISidedInventory

this closes #323 

I replaced inventory[4] and inventory[5] with inventory[INV_ITEM] and inventory[INV_DYE] to make the code more verbose, that's why there are so many changes. Lines 5, 30 and 328-344 are the "real" changes.