backported issue #386 fix to version 0.10
initial scenario support, all tests passing (need write more test)
added tests for scenario support. moved some logic to make code more testable
Merge branch 'scenario-support' of github.com:tekii/mitmproxy into scenario-support