Make text filename-friendly: lowercase and replace all punctuation (except underscores) and spaces with a dash, except at the start and end, where they're removed, and except a single apostrophe inside a word, which is also removed.