ZA: Move sorting of question sections from SQL to Python

The key on which we sort the question sections needed some small
additions anyway, to cover "Deputy President" as well as "President"
and different forms of ministerial sections.  This adds a
key function which can be used with sorted(), and doctests for
its behaviour.

(This might need to be revisited if we need the sections
downstream to still be a query set; at the moment that's not the
case, though.)