Oauth2 code cleanup

I cleaned up the code in the oauth2.js, removed some dead code/parameters, and attempted to [DRY](http://en.wikipedia.org/wiki/Don't_repeat_yourself) it up as much as possible. I'm doing this for my project that will build off your example but figured this hasn't diverged very much yet so if you want it feel free to merge it in.