Gsim validation

Improved the validation of GSIM strings and some refactoring. The tests are green: https://ci.openquake.org/job/zdevel_oq-risklib/132/