Support a "sort" attribute for structural API queries

This is for when listing child structures, to be able to list them by
the total number of views that their constituent laws have had (that
is, their relative popularity). Per #312.
Update code style to meet present project standards