This should fix the icon thing, but might check it out and test before you merge in to make sure it didn't break anything.

The dirname function was returning blank if you executed from the folder in which the file exists.  Passing that result through the abspath function makes sure it is always an actual path, not blank.  Now the icon should work from no matter where the script is executed. Fixes #16