Update Collection+JSON to support templates in queries. Fixes #273