Added onMessage event processing to CommandParser.