GitHub oauth

Fixes bugs and makes it work consistently.