Given the current inheritance structure, this is wrong place to put `embed_js()` in, because it uses methods from `Session`'s subclasses `BaseJSONSession` (`serialize_models()`, `get_ref()`, `make_id()`) and `BaseHTMLSession` (`_load_template()`). There is also `plotcontext`, but that's redefined everywhere.

I presume this is needed together with `PlotServerSession`? `PlotServerSession` inherits from `BaseHTMLSession`, so straight forward solution is to put `embed_js()` in `BaseHTMLSession`. `plotcontext` still will be defined in a subclass, but that has to be universally fixed, so it shouldn't matter here.