add rts functions to allocate lists efficiently from a JS array