Add support and test for output filename template.