engine:

Added `get_hazard_calculations` and `get_risk_calculations` query
functions.
bin/openquake:

Moved some DB queries to the `engine` module.
bin/openquake:

PEP8 cleanup