fix MPD and shortest derivation with DOP reduction.

- When using DOP reduction, MPD and shortest derivation now consider
  multiple derivations in the reduction that correspond to the same
  derivation. The result of marginalize is now a list because
  different probabilities may be returned for the same derivation
  (although Double-DOP still only returns the highest probability for
  each derivation).
- Improved test script.