Serious bugfixes in MemoryGraph. Extended test.

I forgot a whole bunch of transformations, and wrongly assumed that the
order of moves in a transformed position correspond to the order in the
original position. No, the graph should not use the same move index as
the match.