changed mongodb init to safe.
fix ensureindex with callback.