Terrain mesh overhaul

Restructured data structures.  Slightly increased memory usage in
exchange for cleaner code.