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