Implement undo (de-expand), close #31