Template upload: revamp template name, use version file

If version file exists, it will be used. Now it'll look like this:

cfme-5.2.4.2-0624
cfme-nightly-5.3.0.0-15.el6cf.alpha7-0623
miq-nightly-201406242000
While looking through this, it occurs to me that some comments about what you're trying to do with each of these returns would be helpful, like `# CloudForms-x.y.zz-yyyy-mm-dd.tar.gz => cfme-nightly-xyzz-mmdd`. That way, when we inevitably change how we name the images, it's easier to pick apart the various string manipulations to keep this script up to date.