Simplify Results.__iter__

Deduplicate some copypasta from the sorting feature.
dbcore.Results: Avoid duplicate construction

Iterating over a results set multiple times should not take the same amount
each time. We now keep around the materialized objects and re-use them with
iteration. This solves a performance problem in the `play` plugin, which uses
len(results) multiple times and was therefore taking an unnecessary
performance hit when the query was slow.
Second-order optimizations to Results getters

Fix #997. This provides shortcuts for len() and subscripting in certain
situations. There are of course more shortcuts that are possible, but this
will do for now!