Refactor base test classes.

Not all tests are DOM tests; move class-relative resource methods out
into a parent class.
Generic validator framework.
X.509 certificate key length validator.
Generic validation stage framework.