Better integration with the LLVM Target system.

In particular, this is needed to make getOptLevel() work.