MDL-40049 mod_choice: Replaced old add_to_log calls with event triggers.

Also added a generator for unit tests.