Http context factory

- Replaced http mock with http context factory for creating testable
http contexts.