added missing lua_type call for lua_typename
make compat-5.2.c compile for Lua 5.0 (still untested and unsupported)
added some missing stack checks
Merge branch 'master' into uservalue-variant
Lua 5.0 compilation fixes and stack checks