Save source code of object imports and function definitions into spec of root node
Currently, the source code of object imports and function definitions is written to the spec dictionaries of all nodes referencing them, see https://git.scc.kit.edu/virtmat-tools/vre-language/-/blob/master/src/virtmat/language/metamodel/deferred.py#L59 and https://git.scc.kit.edu/virtmat-tools/vre-language/-/blame/master/src/virtmat/language/metamodel/deferred.py#L63. This results in repeated (redundant) object import and function definition statements in the source saved in the workflow.
Much better would be to collect all these statements and add them to the spec of the root node.
This will eliminate redundancies and also reduce the model processor code.
Another important aspect is to be able to extend a model with non-variable statements, such as imports and function definitions. This is not possible currently but should be (-> Principle of Least Surprise).
Later the same procedure will be used to store the vary
statements.