Rework nblib kernel checks and setup code