[Messaging] Stripped trailing whitespace
[Messaging] Refactored event handling methods to std::function, fixed bug in session retrieval