Add the debug and trace output code to MongoDB API (#8)