Added caching to affiliations search.

Also, a couple of tweaks to the ordering of results.