Update Template.php

Added optional overwrite parameter to stop accidental overwrites
Changed saveAs to be non-destructive to the tempFilename
Added listImages capability to template (although not sure if this should go into utility function
Added replaceImage capability to templace (as with listImages, not sure if the implementation should be part of template)
Added getData which saves and then returns the zipFile contents as a stream (helps sending zip files to users of web-apps)