Analytics: Creater wrapper functions

The API to send an event for analytics is waay more complicated than it
should be. This adds some wrapper functions to App so it can be a single
function call rather than several nested function calls. This also
allows us to update the code in one one place rather than at every call
site.