implement C API and mostly Lua API.
implement C API and mostly Lua API.