Removed unused code
Added a method for unloading modules
Bugfix: made sure unload method are run with correct scope