Work on #230
Improve calculation of whether a type is open or closed
Tests for #235
More annotations and metamodel tests