Added a few validation functions

Support code for improving the validation in the engine. In particular to remove the pickled dictionaries causing https://bugs.launchpad.net/oq-engine/+bug/1361981
The tests are green: https://ci.openquake.org/job/zdevel_oq-commonlib/77