Implement multiple level of undo and redo

Signed-off-by: Harsh Gupta <gupta.harsh96@gmail.com>