expanding and closing tables
significantly enhanced
handle metatable and empty objects