Code review: POSIX-compliancy

Only change in the logic - removed two redundant parts of code:
2eda4d4 - ARCHIVE_DIR was never used in the code.
03ee4d2 - unpack will run even if there are additional parameters after the archive name, but will not parse them.

All other changes don't change the program logic and only make script more POSIX-compliant.