Add hashCode() implementation to ProductValue.

Also optimize GroupBy implementation in QueryInterpreter to avoid
unnecessary copying of data.

Fixes issue #215 on MemoryDriver (regression test was failing).

Review by @cvogt