Big refactoring of exception handling.

Pinto now traps all exceptions, and just returns
a Result object.  You can examine it to get the
actual exception objects.