Revert "Replace use of dict for duplicate removal"

The changes introduced by 48bcbbfc92546618d09843f38804769341eaaa61 cause a `'str' object does not support
item assignment` exception; this patch restores the previous behavior
until a more permanent fix to the issue 48bcbbfc92546618d09843f38804769341eaaa61 attempts to address is
made.