Import some function definitions from Lua 5.2.1 and add fallbacks for setfuncs, newlibtable, getsubtable