import changes made by the Luatex team

- Lua 5.2 compat
- various fixes
add fallback for luaL_register