Make internal function static

Not expected to be called from the outside.
Add function for library/plugins reinitialization

The function will be needed for adding/replacing plugins in runtime. This is
just a first shot, it needs testing and potentially some fixes to make it really
work.