Feature/analytics

I believe conflicts are resolved now!
Probably easier to leave this reformatting for another commit.