One thing that's worth thinking about in advance about the load directive is whether there needs to be a way to pass parameters into modules.
In my case I need for the module to be able to know whether it's allowed to generate debug output or not. I can think of many other areas in which I might want to connect to an external resource like a web server or database or whatever and would need to provide the module with information.
load mymodule.so debug
load mymodule.so debug=1
load mymodule.so 1
Obvously this wouldn't work because load allows you do do this:
load fred.so bob.so alice.so
An unsympathetic answer would be:
But imagine telling a programmer in any other language that this was how to instantiate a class or call a function?
load mymodule.so fred.so
Filenames can actually have  characters in them so it's not very desirable.
If the answer is target specific variables then I give up but I will avoid saying why because it will only start a debate. :-)
I also notice that there is a setup() but no teardown() or equivalent. Any module which might have some state will need such a hook so that it can deallocate resources cleanly.