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

Also fix some test failures.