Support merging an arbitrary number of files, rather than always 2.