better handling of python ImportErrors

Also, ensure that a CompilationResult always has a list of
CompilerDiagnostics.