pattern query: test for connected components

Ad an explicit test to make sure that all parts of the query pattern are connected to one-another.  Throw an exception if they are not.

This has two purposes:  1) it prevents users from writing nasty patterns that won't work, and 2) its needed anyway, for the GreaterThan 'virtual' (algorithmic) link, still to come.

There's also assorted cleanup and API changes and modernization.