Cleanup on Tensor classes

This is prep work for #4183. I need to move all tensor math operations into the tensor classes, to avoid outside tensor element write access.