Misc. changes to support flexible mongos deployments.