Added Commands (to handle undo/redo) and tests.