Parameterize mongo connection.
Fix env handling.