[qtcontacts-sqlite] Modify relationships query to use indexes correctly

SQLite refuses to use the obvious index for the previous query
formulation; if we reverse the order of joins it does the right thing.
[qtcontact-sqlite] Use cross join to force query order

SQLite allows manual optimization by using the 'cross join' operator,
which in addition to specifying a join instructs SQLite that it must
process the joined table after the table it is joined to.

Use the cross join operator to ensure we traverse the temporary table
of IDs before joining other data tables by index.
[qtcontacts-sqlite] Remove queryContacts internal batching

The batching inside the query processing code may provide a small
benefit or cost to overall performance; it varies from test to test
and can't be isolated.  Therefore, it is best to remove it for the
purpose of simplifying the code and requiring less maintenance of
state while processing the database records.
[qtcontacts-sqlite] Use maximumCount fetch hint to limit query

Rather than limiting the amount of data returned from the query, we
should limit the amount of data we retrieve from the database.
[qtcontacts-sqlite] Simplify query handling

Separate queries to separate functions to make the query management
logic more self-contained.