Fixing a bug when creating public IPs for new nodes

The `--associate-public-ip` flag didn't actually work as advertised. It still tried to connect to the private IP interface. There were several bugs in here, notably the `wait_for_..._sshd` functions.

I also cleaned up quite a bit of the formatting. Indentation was wonky in several places.