Added a template with an optional constraint.

This is a startling ommision from our set of test templates.
Make a distinction between trimmed and full versions of queries. Fixes intermine/intermine#584
Merge remote-tracking branch 'alex/i584' into beta