Added separate thread for handling callbacks to prevent concurrency issues with the mongo driver. Ideally users would handle callbacks in their own thread by setting a flag, however, this is currently not the case.