Simplified and combined the previous two patches, now with a nice commit message and changelog. Also, stopped moving this functionality into dired, that's not really necessary. Most of this change is tests, and most of the remainder is moving the uniquify-trailing-separator-p code without changes from uniquify.el into create-file-buffer. Hopefully it is fairly easy to review.