Bug 982663: collect and report app usage data

This patch does not have tests yet, and is still missing a couple of features, but it has working code and is ready for feedback and preliminary review.
I recommend creating a uuid here. We have uuid library in JS library.

`Math.random().toString().substring(2);` is also variable in string length. (If you must use `Math.random()`, I usually do `Math.random().toString(32).substring(2, 8);`)