Some refactoring of the classes RiskModel and RiskInput

This is the version I have shown in the risk course. The tests are running here: https://ci.openquake.org/job/zdevel_oq-risklib/52