[WIP] code generation refactor

This PR is based the llvmlite2 branch. My aim was to factor out the code generation machinery from the target context and into a separate facility. CUDA is probably broken as I don't have a device to test (yet).
I had some errors in test_ufuncbuilding when I wrote that. I'll try again, perhaps it was unrelated.
Is there a reference on LLVM linking? I had quite a bit of trouble to find out which APIs to use in order to make all tests pass :-)