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.
Default output isn't a function, but an integer. So it should be like: x.outputs[x.op.default_output] if x.op.default_output isn't None.