Delay timing of instance merging from ShaderGroupEnd until optimize time.

We used to do it inside ShaderGroupEnd. But this seriously messed up any
serialization! You'd expect a serialized version requested right after
declaration of a shader group to return an accurate representation of
what had been originally specified, not some unrecognizeable rewired
network with instances merged and shifted around (even though they would
be computationally equivalent).

So, by default, now we do instance merging right before we optimize the
group.  And just in case you want to force the old behavior (for example,
if you suspect that the as-early-as-possible merging was important for
memory savings), the "opt_merge_instances" attribute (which used to be
simple 0/1 for on/off) now accepts 2 to mean "do it, and do it immediately,
I know this means any subsequent serialization may not resemble the original
input."
Define operator!= for ConnectedParam and Connection.
We defined operator==, seems like the right thing to do, considering
we use != in a couple spots. I don't think that C++ will automatically
define one in terms of the other.
Skip skip LLVM code generation and execution for the interior shader group
nodes that have optimized down to nothing.

This also leads to a more robust test for whether a shader group does
nothing.  Previously, the test was too simplistic: is there only one
surviving instance layer, and does it generate an empty function.
Certain orders of optimizations (especially after instance merging)
could lead to interior shader group nodes that optimized to nothing, but
weren't quite eliminated. Now the test works, because we will avoid
making code for those unused interior nodes.
Minor refactor -- spit out compute_run_lazily() logic.
Also, recompute it after runtime optimization.
Minor improvements in some debug code and error messages.
Merge pull request #426 from lgritz/lg-serial

Change time of instance merging