Completed AgglomerativeDocumentClusterer implementation.