Add tests and use go fmt.

Go fmt got rid of my nice spaces and replaced them with tabs :(