Please refactor the below code using your best knowledge of ES6, and coding standards, docblocks, destructors, etc. As a baseline, I would like it refactored into a class called Messages and generally cleaned up. I am not worried if it actually runs, I want to know you know how to organize code, and leverage the latest ES6/7 standards.