Minor clean-up of prettify_filenames.
Modified prettify_filenames:
1. Set $IFS so it doesn't choke on paths containing white space and
   line breaks.
2. Made a few other minor tweaks to enhance robustness.