Fix a number of bugs in Codegen.
Fix a number of bugs in Codegen.

- Cast all non-base/limit values in/out of UNIVERSAL between operations
- Compute function types for globals and function pointers
- Use extractvalue to unpack return result structs

coq-ext-lib/coq-compile,coq-ext-lib/coq-compile