Added affiliation to thread id and action id. This helps to prevent thread with the
same affiliation from communicating. There are 2 cases:

(1) Prevent actions from the same thread from being matched.
(2) Prevent actions from multiple events in the same choice from being matched. This
is achieved by instantiating all choice helper threads associated with a single choice
to have the same affiliation.