Ran gofmt on the entire codebase and made the code more readable in a few places.

\- Jonathan

__Note:__ I've signed the CLA.
Same as above.