gofmt: minor refactor to permit easy testing
gofmt: minor refactor to permit easy testing

R=rsc
CC=golang-dev
http://codereview.appspot.com/4397046

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