Implemented upgrade functions, plus minor fixes

Fixed private fields in class Item. Changed them to protected.