Update merge_groups.cpp

I added a limit to the number of merges as a parameter to wesley_merge and added a boolean argument to decide whether or not to allow merging of previously merged groups.