Don't code and be asleep!

Revert "Remove duplicate results in index queries, fixes #59. "

This reverts commit a196ebc64fa213dd4f1c9bd77acf029d4fc351db.
Distinct all the result sets with perm checks, fixes #59