Full lua 5.2 support

compatible luaL_register implementation for Lua 5.2