Switch from raw to borrowed pointers in Jit and use BTreeMap