Refactored undoCommand + Fix bugs

> Extracted undoAdd & undoEdit from undoCommand
> Prevents NullPointerException in undoCommand