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 branch 'i584' into dev