Refactor and test https for streaming and full requests

Cleanup and tests as promised.

Again, all tests pass on Ubuntu 12.04 with 1.9.3-p448 and 2.0.0-p247.