This script is a simple, lazy and hacky replacement for dealing with the dom-ready event (DOMContentLoaded
and friends).
Basically, it relies on DOM parsing and script execution order by simply putting a script tag
at the very end of the document and having it call a list of registered callbacks.
Because of the way the DOM rendering process works, we can guarantee that by the time that script gets executed the DOM is fully ready for use.