Hazard curves from gmfs

It is now possible to generate the hazard curves from the GMFs without storing them in the database, see https://bugs.launchpad.net/oq-engine/+bug/1360538.
A QA test case_6 has been added for this feature. There is also a lot of refactoring since I discovered that the produced hazard curves were not reproducible, depending on the random order of the ruptures as read from the db.
The tests are green: https://ci.openquake.org/job/zdevel_oq-engine/604