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.
nit: Fair's fair, I was just getting after Steven about how I prefer a style with single-return. So up above, declare a response variable that consists of JsonResponse('{}'), and then reassign it when something good has happened, and then at the bottom just say return response. 

I feel like this style makes testing easier, and it makes the contract with the reader stronger - you look at that return and you expect every assignment to the variable to have roughly the same type, so if people return different kinds of things it seems extra egregious. It's a sort of type checking by peer pressure. 

It has other benefits too, but mostly it's just a stylistic thing.