opt: transpose(inv) -> inv(transpose)

This transformation canonicalizes sandbox linalg ops so that the various
cholesky-related transformations are not confused by a transpose.
opt: solve(chol) -> solve(triangular, chol)

Cholesky outputs a triangular matrix, so if a general solve is applied to
a cholesky output, then transform it into a triangular solve.
enh: infer_shapes for MatrixInverse
fix: local_log_add dont crash on >2 args
enh: tag_solve_triangular transpose case
enh: faster CGer
check if the node has an owner before accessing owner op
- remove a variable that's not used anymore
- remove unnecessary comments
adding infer_shape test for MatrixInverse Op
testing Solve perform method with specific cases for lower and upper traingular matrices
added unit tests for transinv_to_invtrans and tag_solve_triangular
registering local optimization for Solve op
improving test
updated test so that it tests triangular theano matrices
Fix recursive import. Do not make dnn import opt. opt stil import dnn
fix import of sandbox.cuda when nvcc not avail. Needed for doc gen
Working code for the new context mechanism.  Might have to rework the interface at some point.
Remove struct_id and just use the name.  It is suitably unique and shared with the rest of the methods that need to be.
New method of specifying context: get_context()

This is much cleaner than shoehorning a new argument for all nodes, we
just define an extra optional method for Ops and have a bit of utility
code in Apply.

As a bonus, this also make context passing optional and will not add
any overhead for Ops that do not use a context.
New context registery and switch things to use the new context mechanism from the last commit.