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.