Support validation code for the engine

This is the companion pull request to https://github.com/gem/oq-engine/pull/1516