implemented Undo and Redo

1. CommandType has included UNDO and REDO
2. logic has undo() and redo()
3 StateHistory class is created to store and restore states