Add a better test for service environment variables. Fix bugs.

Closes https://github.com/GoogleCloudPlatform/kubernetes/issues/876
makeLinkVariables no longer tested?