added test for recently fixed crctx bug of duplicate commods
test for incorrect map iteration bug in ApplyThreshold
Merge pull request #814 from rwcarlsen/bugs-fix

add tests for bugs fixed in #811