wip: write support

Not much yet, but produces a correct archive header and fills some
parts of the file headers.