Simplify chainhelper

Minor improvement: no need for the user to specify the type of input.
We can guess whether the input is a file, filelist, or directory, and rely
on the old methods only when this cannot be guessed.
Now working also with comma-separated list of inputs.