Build `names_to_remove` using set operations instead of a loop.
Build `names_to_remove` using set operations instead of a loop.

The loop was used to preserve the order of the names but a specific
order is not necessary--using sorted() is adequate for deterministic,
and therefore easily testable, behavior.

shawnbrown/gpn,shawnbrown/gpn