Set Matplotlib backend robustly during distributed execution

This adds a bit of cruft to the pyscript files that control distributed execution, but I cannot think of a cleaner way to get the backend set that is robust. This approach accepts the configurable value.

The first commit here attempted to set the backend by writing a matplotlibrc to the batch directory, but it turns out that the batch directory is not local for SGE execution so that doesn't actually get picked up. I reverted those changes, but if that is a more appealing route it could be paired with a larger change to the distribution routine.

Otherwise this works fine for me.