Refactored the hazard getters

Now also the hazard curve getter makes use of the assets_gen method used for the ground motion getter.
The tests pass: https://ci.openquake.org/job/zdevel_oq-engine/359/

This is a preliminary refactoring; the final goal is to move the assets -> site association query from the workers
to the controller and to solve the issue reported in https://bugs.launchpad.net/oq-engine/+bug/1288663