So, maybe we can use 3 types of hook:1) add to the end of a page (footer)
Isn't this the same as in r2727?
2) add to the end of a template (patch 2727)3) add to the end (and beginning?) of container/object elements.
Can be done using the 'template_container' hook.