Clean up the cert invalidation code.

* Rename cleanupIdentities to removeInvalidIdentities.
* Extract Method on the code that checked record validities
* Extract Method on code that checks if record is expired.
Merge pull request #3880 from mozilla/cleanup-invalidate-email-records

Clean up the cert invalidation code.