Implement redirect via thrown errors.

Closes #9.