Fixed bugs in saving and loading of diagram and model.
Added 'export as SXFM' operation to the diagram.