Poll until CloudFormation stack has been created

Also fixed randomString function (yes, should have been a separate
commit)