Add sortable column headings where appropriate

Partially fixes #638.