core: comparison: compose results from a single database lookup
core: comparison: compose results from a single database lookup

TestComparison would first retrieve a sorted list of all tests, then do
a second query aggregating the results by environment, etc. If results
for new tests arrive between the first and second query, then
`self.results[test.full_name]` would cause a KeyError. By initializing
`self.results[test.full_name]` on demand when actually aggregating the
results, we avoid this problem and also reduce the number of database
queries.

To keep the feature that the tests are sorted in the result,
self.results must be sorted at the end of the process.

terceiro/squad,terceiro/squad,terceiro/squad,terceiro/squad