Fixing #728 Adding basic support for Github Enterprise

This is the first working version that seems to work for me. Please review/test/etc. 

Let me know if something is off. I know that I am using the same code in many places, We could potentially refactor this into a protected method to get the api prefix.

1st commit came from original work that @Seldaek did to get this started i was trying to wrap up the missing pieces.