Split index handling out to separate package.
Remove duplicated constant.
Lint index.go.