Switch IdNameLookup to use a defaultdict