Continued development of search tools

Significant restructuring, and support for combining partial queries

(work in progress)
Deletion of superseded code; some added comments

(work in progress)