Table sort headers. Fixes #400

Can you please review @mlandauer?