Nowhere near done
A bit closer to done
No errors, no crashes, not done
Works for 0,0,0, some locations need converting

Also added a nice visualizer which I used to debug generation. Try
changing "Small Cave" to "Visualizer" in the map file.
All done