Fix some bugs in handling of interfaces/superclasses as dimensions. In particular:
make sure that the dimensions are retained throughout a calculation (don't infer them from the positions during the calculation)
fix the broadcasting and shaping strategies to take into account the class hierarchies
make sure that operations can be done on tensors with compatible dimensions, e.g. one tensor with an interface dimension and another with an implementation dimension. The result will be a tensor of the interface dimension in this case.
Fix some bugs in handling of interfaces/superclasses as dimensions. In particular: