Basic support for risk calculators in commonlib

The tests are green: https://ci.openquake.org/job/zdevel_oq-commonlib/173/
Notice the companion on risklib: https://github.com/gem/oq-risklib/pull/80
Added; also changed the signature and the tests to make sure that for hazard curves the probabilities are given in decreasing order.