CMF-35: Add an ability to save a diagram in internal format