On the detection of functionally coherent groups of protein domains with an extension to protein annotation