Purpose of this commit is to try to make code a bit easier to follow using dicts, sets and tuples, as well as updating some variable names. Also rename the method to be clearer. Tools methods may omit the namespacing to avoid too much confusion in naming. Task-2710804 (Mail: Clean MailThread API) Part-of: odoo/odoo#106658