In-line Analytics

PR for internal review purposes as prelude for PR to upstream
    PR'd against copy of upstream master.

Known issues to be fixed later:
- Styling is embedded in html file as prelude to re-styling
- No tests
- pep8 and pylint not looked at yet.

@jbau @jrbl @stvstnfrd @caesar2164 if you please.
Yes, this is going to need an IIFE at the least. Else, all of your top-level `var` and `function` declarations will leak into the global namespace.
```javascript
(function () {
    'use strict';
    // Your code here, starting 1 indent deep
}());
```