Work on #184 - `outer` ref is now generated as `$$outer``
move metamodel to constructor; gen $$outer ref in both modes