Use the github api and allow gist url override.

These changes make it possible to use gist with github enterprise by using the github API and allowing the gist url to be specified either in the CLI or in the local .git/config file.