allow selecting the backend by setting the environment variable MPLBACKEND

This commit adds a new way of selecting the matplotlib backend. The `-d` flag can cause problems with scripts that use the command line arguments as parameters and don't ignore unknown ones. An environment variable `MPL_BACKEND` can be set by the user (or in the code) and is far less likely to cause problems than using the `-d` flag.
I don't think so.  It was environment variables that contain Unicode paths that were giving us grief.  In this case both the key and value should be ascii.  (It's possible that someone might use unicode in the "module://my_custom_backend" form, but doing that on Python 2 would be insane/impossible for so many other reasons, it's not worth worrying about).