There are three commits in this pull request, each making its own change. If you'd like me to split them up so that you can accept only some changes, I can do that.
One commit changes the 'ref' script so that it adds its own directory to PYTHONPATH so you do not need to put ref into python's system path. The second commit makes ref call 'open' instead of 'xdg-open' on Macs. The third commit ensures correct alignment of columns even when names or titles contain non-ascii characters.