Added nameByIdCache

This removes a lot of silly DB queries that really ought to be cached,
since they are nearly unchanging.  (At the moment, there is no way for
them to change, and likely won't be for a good while.)