Added GPL license
Removed dependency on $pathd variable
Updated chdir code to use path called from

 - Big thanks to Supun Rathnayake (https://twitter.com/supunr)