Ensure class names are valid R variable names.