Bug 982663: collect and transmit app usage metrics

In order to avoid impacting the startup performance of apps, we should probably defer some (at least the writeData call) or all of this for a couple of seconds so we give the app a chance to launch and stabilize before we hit the database ourselves.