(bug 56134) Improve JS initialisation function handling.

* Move init.js to the base class.
* Instead of listening to an event handler, call a "registerInitFunction" Flow function,
which both registers the event handler for the future *and* runs it on all already-initialised
Flow containers.
* Hopefully fixes bug 56134, which was probably caused by inconsistent load order meaning that
not all initialisation functions were being registered before the flow_init event was triggered.

Bug: 56134
Change-Id: I3a7d517853a8b4993cf6918d30cfdd6b8a8fddea