Support for auto swap.

Fixes #1339
Consider taking HttpContextBase for mockability?  No dependency on HttpContext.Current.