Assert that test values (if any) of replaced nodes match with replacement
Make it easier to use test values with Rop and optimizations

In particular, use op.__call__ rather than make_node, so the
tag.test_value gets computed automatically.

The weird syntax with **dict(return_list=True) is because in older
Python versions (including 2.4), you cannot pass a named argument
(return_list=True) after an expanded list of unnamed arguments (*args).
You can, however, pass an expanded dictionary of named argument
(**kwargs).
Add new checks in optimization, to prevent incorrect replacement.

We want to avoid merging different outputs of a scan node, that compute
the same thing, but keep a different number of steps.
Fix circular import
Fix case when test_values do not have shapes
Add test case
Merge pull request #1578 from lamblin/fix_scan_merge_inouts

Fix scan merge inouts