Refactor CloudFormation template uploads

@sopel, care to review?