Cache tileset lookup in map so GetTerrainIndex and GetTerrainInfo need not repeat it every time.

The lookup accounts for ~50-60% of the time spent in GetTerrainIndex and GetTerrainInfo, and these methods themselves can account for up to 1.3% of total CPU used so this is a small but measurable win.