Cleanup main packaging script

A summary of proposed changes:
* Convert argument parsing into for-loop and switch-case (easier to read).
* Favor `[[ ]]` over `[ ]` (it's either that or quoting all the variables...).
* Quote all path/file variables (safely handle filenames with spaces).
* Quote all strings & remove trailing white-space (aesthetics).