Sanitize replicaset name

implements the cleanup changes to `replicaset_name` mentioned in #171, also incorporates #171