added trap for graceful exit
added check for valid directory
Code cleanup
code cleanup, added comments
experimental feature to download directory as .tar.gz
* possible security issue with tar