Adding bootstrap process for creating AMI

Fixing bugs in the bootstrap script, dealing with weird environment
problems.