autocomplete results should be ordered like search results

Of course I did this by making search and autocomplete call the same
basic functions. Fixes #34.