Enable `am` applying patches from private repos

Fetch the patch using GitHub's API instead of curl.

Fixes #397
Explicitly declare we're using GitHub API v3 when fetching patches

This shields us from future changes to GitHub's API
Rewrite `hub am` to get rid of usage of curl altogether

With patches now fetched from GitHub's API, it was awkward to keep
fetching raw gists using curl. This makes it so patches from gists are
fetched using the API as well.
Merge branch 'private-patch'