Refactor to allow different types of redirects.
Merge pull request #5 from bbeck/master

Refactor to allow different types of redirects.