Delete element from table when value is set to nil

For some reason which I cannot remember this was not previously done.
Update table.insert and table.remove to behave as for Lua 5.2.2

This actually made them much less tolerant of trying to add/remove
values from outside the 1..n range. Although it still has the
"strange" way of find the size.