This is code originally extracted from buildbot's highscore project.
Factor out token getting.
Make private stuff private in github api.
Add gist endpoint.
A bunch of improvements and refactoring.