Create SEO friendly URLs (or just slugs) in JavaScript