Terrain generator

Added a bunch of optimizations and restructuring to the map generation. Caves are hard, so that will be a problem solved another day.
Tiny nit: `noise.Perlin` would be a slightly nicer name :). Or maybe noise.Perlin3 (in case we add 2d perlin noise in the future).