Sent the tectonic region types with less sources first, and fixed an ordering bug in a QA test

See https://bugs.launchpad.net/oq-engine/+bug/1327097. This PR requires two companions: https://github.com/gem/oq-commonlib/pull/11 and https://github.com/gem/oq-nrmllib/pull/127

Notice the change in the QA test case5:  when comparing the actual GMFs from the database with the expected ones, extra care must be taken to avoid ordering issues.

The tests are running here: https://ci2.openquake.org/job/zdevel_oq-engine/383