Add countItems utility that counts the quantity of an item type in an inventory. Fix issue #135 opened by mythan.