Handle exceptions raised in Python or Perl code correctly

We now handle user exceptions, invalid function or method names and
passing exceptions from Perl through Python back to Perl.