fix emit and update
add support for directories and empty archives

- in case no files have been added it is possible to write end of
  central directory record only which is known as 'empty zip archive'.
- add support for directories (empty file entries)

also make sure 'end' does not fire twice