[init] new init hook system

Allows code anywhere in the system to define an init hook which is
called at the run level specified.
Hooks are guaranteed to be called in order of init level. Within an init
level the order of the hooks is not guaranteed.
[lib] move a few libs to the new init hook system