Refactor to DiagramModel / Make model restorable / Fix memento pattern usage