[WIP] Tensor tree expressions

old tensor module moved to `deprecated_tensor.py`

There are many `TODO` to be fixed, some tests still to fix.

There is some degree of performance regression, that's why I kept the previous code in a separate file.

This is an enormous refactoring, more explanation will follow sometime in the future.