Bug 961526 - Part 5: Fix testMeasurementRecordingConstraintViolation.
Bug 961526 - Part 6: Correct bug in invalidation (srsly oops).
Bug 961526 - Part 7: Make pruneEnvironments comment more descriptive.
Bug 961526 - Part 8: Add environment cache clear testing.
Bug 961526 - Part 9: Remove TODO (it works correctly).