Add capture_exceptions decorator.

This decorator wraps functions in a try/except block, calling captureException
if it fails, then reraising it.
Merge pull request #432 from andor44/decorator

Decorator for captureException