Added tree and node classes
Reimplemented undo with tree