Support caching of names data

Speeds up generation performance by 500x.