Reformats using go fmt.
Moves the main function to top.
Merge pull request #2 from olivernn/reformatting

Reformat file to make it more idiomatic