Important fixes pre-2.0 copied from the better-risk branch

1) fix when reading the ruptures from the db in the event based hazard calculator;
2) reflected the API changes in risklib/commonlib
3) fixed a bug with nonparametric ruptures not being saved in the db
4) added more debugging info in the QA tests for risk