Tree updates properly after undo/redo

Also, remove tag button above editor now works as expected after
selecting a tag through the tree.