initial support code for writing WAD files, unfinished and untested