Clean up CMStats code.

Besides the cleanup, make sure to wait a bit between retries if upload fails for whatever reason.

JIRA:CYAN-1187
Change-Id: Ifca8364721007aadef31b328d22d764ef7cb3b0a
Merge "Clean up CMStats code." into cm-10.1