move the Lua wrapper into a separate library