Completed TODO in as_tensor_variable which said to strip off leading bro...

...adcastable dimensions.
Add a test where x is defined as a matrix to make sure we raise an error.