Implement sub-query predicate parameters.

Closes #40.