Optimize DartResolveUtil.getLibraryName() and fix its usages