Improved module detection: subclasses and interfaces should now work in all
execution modes.