db/models:

Added `__iter__()` to UHS class to make serialization easier.
export/hazard:

Added `export_uh_spectra`.
tests/export/hazard_test:

Added to `test_classical_hazard_export` to exercise UHS export.
Merge pull request #1092 from larsbutler/uhs-export

UHS Export

[r=matley] [f=1082312]
qa_tests/hazard/event_based:

s/poes_hazard_maps/poes/
db/models:

Cleaned up the `hazard_metadata` logic.
calcs/risk/classical/core:

Fixed a `loss_ratio_curve_matrix` indexing bug in `classical()`.
db/models:

Fixed the logic in Output.hazard_metadata to handle more cases.

I'm still not sure if it covers all cases (haz output or haz calc,
loss curve or loss_map, etc.), but at least this reduces crashes during
XML serialization due to missing metadata.
calcs/risk/general:

Fixed an issue where the risk engine would create mean/quantile `Output` and
`LossCurve` records for _each hazard output associated with a realization_.
This is wrong. It should create a mean container if `mean_loss_curves = true`
and 1 quantile container for each `quantile_loss_curves`.
tests/calcs/risk/event_based/core_test:

Changed some docstrings into comments, so we don't throw garbage into the
nosetests -v output.
calcs/risk/classical_bcr/core:

Safer unpacking of `output_containers` results.
calcs/risk/event_based/core:

In `output_containers`, mean and quantiles now come at the end.
calcs/risk/event_based_bcr/core:

Safer unpacking of `output_containers` results.
tests/calcs/risk/general_test:

`create_outputs` now does NOT create means and quantiles.

Before, it was creating a bunch of extra records that weren't needed.
db/models:

Fixed an indentation error.
bin/openquake:

When printing a list of outputs, order by output_type
tests/data/end-to-end-hazard-risk:

Added a pair of hazard/risk demos to test end-to-end calculation functionality
and ensure that outputs can be generated and exported properly.
tests:

Renamed `helpers.get_risk_job` to `helpers.get_fake_risk_job`.
tests/utils/helpers:

Wrapped a line which is too long.
tests/utils/helpers:

Added `run_risk_job` and `get_risk_job` util functions.