This adds initial support for writing new/modified maps, which are made up of layer groups (LGB) and terrain (TERA). Neither one is really tested yet, but I started checking some simple examples and it seems to work.