Refactoring
Added writetodisk method, completed addItem, working close method with mode="a" or "w"