Major refactoring of the analytics features. This change is not backwards compatible due to API changes.