Completed TODO in tensor.py:as_tensor_variable which said to use the App...

...ly default output mechanism.

Added tests to excited the various possible failure scenarios.
Idem for the others tests.