Use IO.pipe to create tar file

Use `IO.pipe` instead of a `StringIO` to avoid storing the whole tar
file in memory.
Create directories for submodules

Add empty directories for submodules in both zip and tar files when
archiving a repo.