Improve modloader

Add onUnloadModule and unloadSubmodule etc.
Add code to work with new modloader