fix bug in instantiateVars function for SharedTerms
fix bug in instantiateVars function for SharedTerms

The bug was caused by an interaction between the memo table and the
Change monad transformer. The problem was that the memo table did not
store information about whether or not the result value had changed
the input, so whenever a memo value was re-used the Change monad would
assume it was pure (i.e. unchanged) and the changes would be lost.

The solution was to store a Change type in the memo table.

GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script