Fix "sort_order" bug in catalog query view.

The problem is that the catalog does not support unicode strings, resulting in wrongly sorted brains.
Since the query is submitted via HTTP in json and `json.loads` always returns unicodes, we need to recursively convert the strings back to `utf-8`.

/ @maethu