Added MeanLossTestCase and some comments/docstrings

Added a test case explaining the ordering issue described in https://bugs.launchpad.net/oq-engine/+bug/1361533.
A change in the engine will follow. The risk tests are green: https://ci.openquake.org/job/zdevel_oq-risklib/35