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.
To follow up on @jrbl 's comment about performance...

It's less about how much you add to the DOM and much more about how many
times you touch it. Each time you modify an element in the DOM, the page
must reflow.  Do it a few times, the browser keeps on keeping on; start
doing it 1000s of times in a loop, browser crawls to keep up.

The general rule is that you should never manipulate the DOM
iteratively. You want to build up your entire payload first, then inject
it into the DOM all in one go. If I'm ready this code correctly, it
looks like you're adding a new row _after_ the last row in a table upon
each iteration of the loop. Try something like this:
```javascript
var results = {};
var key;
var table = $('#' + elementId + '_table');
var tr;
var trs = [];
for (key in results) {
    if (results.hasOwnProperty(key)) {
        tr = $('<tr><td>...</td></tr>');
        trs.push(tr);
    }
}
table.append(trs);
```