Fix remaining compilation blockers including move some functions into a shared module that gets built into core LLVM.