work on #212
Fix #211
resolveAliases() for #212
Tests for #212 and other metamodel stuff