Invariant support [#286, #81557010]

Changes to allow the automated testing of class invariants, as explained in issue https://github.com/pivotal/cedar/issues/289