Rewritten the RiskModel class and introduced RiskInput

This is a refactoring needed to support the simplification of the risk calculators on the engine side: https://github.com/gem/oq-engine/pull/1566, https://github.com/gem/oq-commonlib/pull/46.
The tests are green: https://ci.openquake.org/job/zdevel_oq-risklib/49
Perhaps this method could be renamed into something like ```get_taxonomy_if_unique```