cmd/godoc: emit id's for constants and variables

Fixes issue 5077.

R=r
CC=golang-dev
https://codereview.appspot.com/8021044