move tx loop to C code
add luajit dependency