Add logic for ordering topic elements

Exposing this logic in the admin interface is proving more difficult
than it should be. To be continued…