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
Not really. The core_func makes sense only for parallel calculators. It must be possible to define sequential calculators without defining the core_func. If it was an abstract method (which is not, it does not depend on self) the user would be forced to define a fake core_func without any good reason.