Switch to importlib and fix module loading