Fix indents in module loading and revert duplicate code removal
I really wish there was a way to not have so much duplicate code, but right now I can't think of much without breaking it.
Remove obsolete brackets in module unloading