wordpress-mobile/WordPress-iOS — pull request #1546 by sendhil (2014-04-08 22:29:54+00:00)
Title: Clean Up Mixpanel

As per @mikejohnstn's [suggestion](https://github.com/wordpress-mobile/WordPress-iOS/pull/1534#issuecomment-39650679), I cleaned up our stats implementation to be less attached to Mixpanel and more generic. Our previous implementation let far too much of Mixpanel bleed into the regular everyday goings of the app and forced the end user to have to think through different implementation details that could have been easily masked.

Now instead of having to call different methods such as `trackEventForWPCom` or `trackEventForSelfHostedAndWPCom` or `trackEventForSelfHostedAndWPComWithSavedProperties` or `incrementProperty:forEvent`, etc., you can just call `[WPStats track:event]`.

A few implementation details of this change:
- Removed `WPMobileStats`
- Created `WPStats` class that acts as the entry point for all things stats. This class is removed from being to closely tied to any stats implementation as the only methods you can call are `track:` and `track:withProperties:`. The `WPStats` class has a `WPStat` enum with all the possible stats we want to track. Any new stats should be added as an enum here and then implemented in the respective client implementations as appropriate (realistically it'll just be the Mixpanel implementation).
- Created `WPStatsClient` protocol to interface with different possible stats implementations.
- Created `WPStatsMixpanelClient` and `WPStatsWPComClient` as we had stats being sent to both Mixpanel and Wordpress.com.
- The bulk of the code is in `WPStatsMixpanelClient`. Created `WPStatsMixpanelClientInstructionsForStat` to contain the 'instructions' for each individual `WPStat` as different stats will want track different things. I'm still chewing a little on the naming here so any suggestions would be appreciated.

If this implementation is approved I'll go ahead and port it over to Android.

Fixes #1538