Add shared AnalyticsHelper singleton, clean code

It’s a lot more convenient to just setup your AnalyticsHelper instance once, and then use it everywhere, so I think a singleton would be useful here. 

I’ve also seized the opportunity to clean and reformat the code in general. I hope you don’t mind, the code really works the same, it’s simply more consistent.

Anyway, thanks for the code, it’s been really helpful for us!