make EM_ASM use strings on the heap, so it works in asm, and cache the generated functions