Implement writing veins tile by tile through MapCache.

Unlike changevein, which changes the material in an existing vein
object, with this feature you can set the material for individual
tiles, and the cache will write it out as vein objects.

The array inside the cache data is changed from layer material to
vein material, because layer material is easy to compute.
Implement a MapCache api for writing base layer tiles of arbitrary stone.

Precompute some tables in TileTypes for extremely efficient
conversion between tiles of most important material types.
Decode ice under constructions if possible, but never write it out.
Expose new MapCache features in probe and tiletypes.
Remove "using namespace std" from MiscUtils.h.
Use a cast instead of floor in perlin noise for performance.
Implement reading and writing the map for 3D veins plugin.

This should completely erase all veins from the map when run.
Implement generation of 3D veins that match the existing mineral counts.

It remains to implement actual nice looking vein distributions.