Abstract GithubGist behavior out of index.js

I've starting working on breaking behavior out of index.js as described in #19. I would love some feedback on how it's going.