Query code moved into its own library lib-foquery.