Refactoring of risklib needed to solve the problem of the block size dependence

See https://bugs.launchpad.net/oq-engine/+bug/1242372