Add mergeCollection, diffCollection and intersectCollection functions with tests