Modify merge() function

Function merging products was returning True or False to indicate
whether a merge took place. I modify it to return a position (index) of
the molecule which was merged. If there was no merge, it return a
negative value.