Added a "node_factory" validation facility to the node library

This is here to support the work on nonparametric sources (https://bugs.launchpad.net/oq-engine/+bug/1364418).
By writing a suitable "node_factory" in commonlib it is possible to convert all sources from NRML to hazardlib objects in few lines of code. That means that in the future nrmllib could disappear.