Added test mode to mongodb_server.py

This generates a random port to listen on and creates a corresponding dbpath under /tmp. The port is tested to see if it's free before it's used.

This closes #77 and #75.