Scan crash fix

Do not merge, it is not ready for merge, but I want feedback, especially on the commit  https://github.com/nouiz/Theano/commit/bd67fd8a1aaada905f2e45434ae2ce0b49ce2579

All the commit above this one are stuff to help debug it!

@pascanur, can you review the change to scan? Also, should we do a similar fix to the line above? @lamblin suggested to replace the line above by:

    outer_inp_seqs += [x[::-1][:scan_node.inputs[0]] for x in self.outer_mitsot_outs(outs)]

Runing scan tests with this modification don't raise problem. But I think this just show it is not tested.

NEWS.txt:
- Fix shape crash inserted by Scan optimization. The gradient of some recursive scan was making the PushOutSeqScan optimization insert crash during the execution of a Theano function. (Frédéric B., reported by Hugo Larochelle)

Theano flag:
- Add a new Theano flag: compute_test_value_opt. It take the same value as compute_test_value. It enable compute_test_value during Theano optimization. Only useful to debug Theano optimization. Also small changes to some optimization to work correctly in that setup. (Frederic B.)
- Add the value pdb to the Theano flag: compute_test_value and compute_test_value_opt. (Frederic B.)
- Add the Theano flag: optimizer_verbose. Default False. When True, we print all the optimization being applied.(Frederic B.)

Internal:
- Scan optimization now report as reason the optimization tag (Frederic B.)
  This allow to easily now witch tag to exclude to disable an optimization.
- Scan and elemwise fusion optimizer now register its name as a tag. (Frederic B.)
- In the optimization wrappers in2out and out2in, remove an not needed intermediate wrapper when there is only 1 optimization (Frederic B.)
- Chagen FunctionGraph Features interface of the {on_prune(),on_import()} call back to take a reason. (Frederic B.)