Refactor lib/github.js a bit.