Rewrite extended query to be a single enormous join

* Basically, use separate queries to find all possible Dashboard-visible
  objects, then intersect with search results via "ON" condition.  This
  is substantially more efficient than subqueries in the WHERE clause
  or nested JOINs.
Fix ADMIN_PERMISSION contexts lookups
Remove too-eager optimization
Merge pull request #591 from reciprocity/feature/improve-fulltext-query

Rewrite extended query to be a single enormous join