Tweaks in the update script.

Better variable names, check unpushed/uncommitted stuff before updating and remove unnecessary pushd & popd.