Changed internal functions to be private, leaving only the API public.

gofmt'ed all files.