Fix race condition. Ensure mongo is connected before cleaning the db.
Rework configuration. Get rid of argv parsing for now.