clicking a sort header in the search results should only sort the list once

This boils down to a deficiency in the templating engine. Read the
docs for how 'block' works, and if that doesn't clear it up then ask
me to explain it; it's important.

Fixes #39