Moved mean and quantile functions from the engine into risklib

See and the companion https://github.com/gem/oq-risklib/pull/110.
The tests are running here: https://ci.openquake.org/job/zdevel_oq-engine/944/