Rename 'augments_with_ref' by 'extend' and be more flexible.
Handle NodeFactory in scopes: lazy nodes instantiations, simplify code by replacing nodes loops by NodeFactory instances.