Made more corrections and additions to ffi

Corrected extern fn definitions, and added Lua's pseudo-index constants