Converted operations count test to use scalacheck.

It's pretty nifty. Also fixed a couple bugs which this more
thorough testing revealed.