Added basic authentication as used by the Docker client.
Tidied up some golint errors.