lib.select(), table.insert() and table.remove() updated to use native array functions.