itd: Rewrite hpacker

It no longer uses temporary files.
hpacker: Ignore first argument (program name)

That caused arg parser to always exit.
hpacker: Rewrite index building

Now it writes file index on last step, thus removing the need for extra
work on keeping track of file offsets.