S3 Bucket support for CloudFormation template operations

I'm a little confused here.
This probably lacks better documentation.

This function either stores the file on S3 or doesn't, the two different behaviours should be documented IMHO.

When does it use S3? (aka, what parameters should be set if that's the desired behaviour)
Perhaps we should have a new class, Template, which could be a string (for uploading directly), or an S3 URL for using S3.
Perhaps it could also handle the uploading to S3 and leave this code out of here.

What do you think?