Make outtmplfn in RESTFileMetadata optional and give it a default value. Fixes #4574.