godoc: use a bufio.Buffer to read search index
godoc: use a bufio.Buffer to read search index

Also: Minor refactoring for cleanliness and symmetry.

Fixes issue 2286.

R=r
CC=golang-dev
http://codereview.appspot.com/5232041

wesolows/golang,firebitsbr/golang-old,wesolows/golang-old,wesolows/golang-old,firebitsbr/golang-old,firebitsbr/golang-old,wesolows/golang-old,wesolows/golang-old,firebitsbr/golang-old,wesolows/golang,wesolows/golang-old,wesolows/golang,firebitsbr/golang-old,firebitsbr/golang-old,firebitsbr/golang-old,wesolows/golang-old,wesolows/golang-old,wesolows/golang,wesolows/golang,wesolows/golang,wesolows/golang,firebitsbr/golang-old