fix command conversion

The command may of other type than UndoSetNodePos, since we work with
node id's to identify merging. Hence, guard with dynamic_cast...
turn DemoWidget into a MainWindow
implement Tikz::Document::clear()