Moves OAuth code out of Orbiter and into lib