Added additional logic for upgrading GAE SDK
Fixed some idempotency bugs

Noticed that there is a new bug on line 89 when installing node and npm.
I spent some time debugging this but could not figure it out, so I will
have to return to this later.