Refactor invoke-primitive internals
Add invoke-primitive to the JIT