This fixes #656

I moved this sorting feature out from the multisearch  pagination as that is fixing many issues and it will be clumsy to verify each. I will raise separate PR for that.
@gordonwoodhull please review this and let me know your feedback.