Tom - adding code to deal with setting up replicasets when auth is on and doing a bit of refactoring helper functions into a module.