Refactored collection classes into MessageCollection, NumericTypeCollection, and StringTypeCollection templates.