Event loss tables

Implements https://bugs.launchpad.net/openquake/+bug/1132699

For a clean diff, https://github.com/gem/oq-engine/pull/1053 should land first.