Enable MongoDB tests when -Doptiq.test.mongo=true.

Also fix some test failures.