Generalize handling of merged TypedPipes

This flattens merges all the way out into a List, then checks for duplicates in that list. If they exist, do a local self merge leaving us with only distinct pipes, which cascading can handle.
Just a note that we must rename the pipes if we use the merge call since cascading can't handle the multiple pipes possibly with the same name? -- "When using the merge primitive we rename all pipes going into it as Cascading cannot handle multiple pipes with the same name."