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

mhennings/marcohennings-go,sanjosh/sanjos100-tipc,webfd/go-zh,bryanxu/go-zh,glycerine/jeaten-go-arrayof-structof,Triskite/willstone-goclone,Triskite/willstone-goclone,Triskite/willstone-goclone,d0f/go-zh,mhennings/marcohennings-go,webfd/go-zh,mhennings/marcohennings-go,sanjosh/sanjos100-tipc,sanjosh/sanjos100-tipc,sanjosh/sanjos100-tipc,rflanagan/reginaldflanagan-project1,d0f/go-zh,bryanxu/go-zh,glycerine/jeaten-go-arrayof-structof,d0f/go-zh,Triskite/willstone-goclone,Triskite/willstone-goclone,rdp/rogerpack2005-golang,bryanxu/go-zh,d0f/go-zh,webfd/go-zh,bryanxu/go-zh,sanjosh/sanjos100-tipc,scirelli/scirelli-go,bryanxu/go-zh,sanjosh/sanjos100-tipc,rflanagan/reginaldflanagan-project1,scirelli/scirelli-go,webfd/go-zh,rdp/rogerpack2005-golang,d0f/go-zh,rflanagan/reginaldflanagan-project1,glycerine/jeaten-go-arrayof-structof,rdp/rogerpack2005-golang,glycerine/jeaten-go-arrayof-structof,scirelli/scirelli-go,rflanagan/reginaldflanagan-project1,scirelli/scirelli-go,mhennings/marcohennings-go,sanjosh/sanjos100-tipc,rflanagan/reginaldflanagan-project1,bryanxu/go-zh,glycerine/jeaten-go-arrayof-structof,Triskite/willstone-goclone,rdp/rogerpack2005-golang,scirelli/scirelli-go,scirelli/scirelli-go,rdp/rogerpack2005-golang,rdp/rogerpack2005-golang,webfd/go-zh,mhennings/marcohennings-go,rflanagan/reginaldflanagan-project1,Triskite/willstone-goclone,d0f/go-zh,mhennings/marcohennings-go,rflanagan/reginaldflanagan-project1,glycerine/jeaten-go-arrayof-structof,Triskite/willstone-goclone,mhennings/marcohennings-go,glycerine/jeaten-go-arrayof-structof,scirelli/scirelli-go,mhennings/marcohennings-go,scirelli/scirelli-go,d0f/go-zh,rdp/rogerpack2005-golang,webfd/go-zh,bryanxu/go-zh,webfd/go-zh,glycerine/jeaten-go-arrayof-structof,webfd/go-zh,sanjosh/sanjos100-tipc,d0f/go-zh,rflanagan/reginaldflanagan-project1,bryanxu/go-zh,rdp/rogerpack2005-golang