Added support for Targa files.

Hi,

I've made some changes to the script and I thought others might appreciate them as well:

* Added support for Targa files.
* Code re-organised to allow for easier additions of new file formats.
* Spaces in layer names are changed to '_' and not eaten anymore.
* Script changed to run only on hitting the 'Continue' button.