Update util.js

Added toSlug function