Improved testwrites and testreads to use a negation mask.

This allows repeated tests, if you change the negation mask each time.