Analytics round 2

Closes #1014 
Closes #1015