Intermediate commit.

Migrating complex query execution control to QuerySpecification.