Nearly finished making value work correctly with loops.
C++: All tests pass
C++: re-order field initialization in transaction to avoid compiler warning.
C++: Remove some unused local variables.