Refactoring in preparation for supporting spdy multiplexing.