Use a 'slugify' library to sanitize environment IDs (like the UI does)