Analytics export

This is on top of the security-tasks branch, so that Pull Request (#706) needs to be merged before this one.