fixed generate_slug method to make sure there are no loading or trailing whitespaces. And the remove all non-alpha, non-dash and non-underscore characters.