Update @mmrobins #247 ("Add a uri_scheme option") by merging with master

#247 from @mmrobins adds nice features for those of us with GitHub Enterprise and a server with only HTTP; no HTTPS.

Unfortunately, #247 was never merged and the code on master evolved and #247 doesn't merge cleanly anymore.

I don't want his work to go to waste though, so I went ahead and merged his changes with master to come up with this PR.

Maybe this can be merged?