Make instances a property
NodeDefinition instead of SourceDefinition
Remove unused contextMap
Playing around with typescript.