refactoring of id-related metatables
refactor type sorting
renamed comma variable
made inspect.lua not object-oriented
reordering of code in inspect.lua