Factor out spawning mongod