Make it easier to override email template names when importing tests
Adds middleware to stash original http referrer on session