Fixed bug in contraction of data in tensors

After merging the data PR and the auto-matrix PR into the tensor module, I tried to use them and I realized that they were clashing. Furthermore, I detected a serious fault in the contraction of data in a tensor, the numpy `tensordot` could be applied on the wrong row.

I hope this gets fixed before 0.7.4