Summaries for state changes & list of last 20 states on the web check details page

I'm not sure that this does exactly what's desired, but it should be most of the way there if not.

NB: I copied in some of the refactorings from #222, as the code required changes to the same areas and I wanted to minimise problems for future me.

May fix #216.