Moved all OAuth functions into a package, rest of app into an example.