Support for nonparametric sources and a bit of cleanup

See https://bugs.launchpad.net/oq-engine/+bug/1364418. I am also adding a better assertion for wrong IMTs and a more relaxed check for PMF, so that the usage of Decimal is no more necessary in hazardlib. See also che
companion PR on commonlib: 

The tests are green: https://ci.openquake.org/job/zdevel_oq-hazardlib/94