Make code more testable
Add a spec for GitHub Enterprise support