reverted slugify function to be python 2 compatible