Track thrown exceptions using a stack to support nested catch blocks.

Fixes #83.