better formatting/reporting of Python runtime errors

We still have some work to do on getting Python runtime errors
(such as NameError due to a misspelled variable) to be displayed
nicely in the UI.