[WIP] Make the JIT work on OS X

Please don't pull this internally. WIP PR so that others can look at it / play with it.