Code review: POSIX-compliancy

Only logical change - 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 doesn't change logic and only make script more POSIX-compliant.