Implementation of TypeID in Lua