Fixing license headers.
First take on search request templating.

Relates to #5122

Adds templating support to search requests. Adds only the templating support
itself. Referencing templates as part of the search url is left for a second
commit.

Refactors template parsing into helper class to avoid duplication.