Add capture_exceptions decorator.

This decorator wraps functions in a try/except block, calling captureException
if it fails, then reraising it.