Upgrades use set now, too

This prevents duplicate units (easy to do if you have multiple,
overlapping tags). This also cleans up the code (the previous
method of checking for duplicates was a bit messy).