upgraded item.js  to have a lot more error checking and better item storage, no tests are written for item.js yet