After a very cursory scan, it appears that he's shadowing a lot of standard Lua functions to provide his own versions, like a replacement for ipairs that checks an __ipairs metamethod first, that sort of thing. It doesn't actually look that complicated to me, but I've also done a bunch of embedding-Lua-in-stuff projects before.