Resolve implementation internals ephemerally and do some minor cleanup.
- resolve ephemerally as much as possible inside of implementations;
- get rid of the
set(Invariants|DoValidate)
functions; use a setter instead; - use a getter to access invariants and doValidate (instead of accessing "private" members);
Bug: T359872