Fix broken unit test from new mongo driver.
Make ObjectId safer and allow machine name and process id retrieval to
be overridden.