Refactored MessageManager and MessageManagerTest using "dql-fit"

Refactored MessageManager and MessageManagerTest using "dql-fit"