[MRG?] DOC show referring examples on API reference pages

This places an example gallery on each API reference (class, function) page. Currently this is at the end of the page. It might be nicer for this to appear under the "examples" section, but that is much harder to implement (except perhaps by Javascript/DOM games). The intention is that this should provide a manual of examples for a particular class in many cases, such that, for example, the use of `PCA.components_` should be more obvious (cf. #3322).

The CSS/Javascript/Python that makes the example galleries work is a bit of a mess, but I'm only cleaning it up minimally in this PR.
as in you'd rather
```python
for fig_num in (fig_mngr.num for fig_mngr in
    matplotlib._pylab_helpers.Gcf.get_all_fig_managers()):
```
I think I mostly intended to fix PEP8, but the long name made this hard.