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 add on, I don't think returning HTTP status code 200 with body `{}` to the browser is the right way to indicate an HTTP error happened on the server's API call.  You should be returning a different status code (400?) with some error message.