made slugs unicode-safe like

This should fix #36. I wrote it mostly like mozilla's implementation.

PS: the like at the end of my commit has no sense, I just forgot it there.