Fix regression causing non-global config options to be ignored when replacing placeholders in output filename format. #1831
Better fix for non-global options not being replaced in filename placeholders. Includes refactoring and a new PlaceholderParser class. Also includes regression tests. #1831