Add argcheck for indexing into tensor with a table

We check that the number of indices provided is
not greater than the number of dimensions.

This is done for both __index__ and __newindex__.

Also added unit tests for index lookup and index
assignment.