Factor out OAuth login from package-client
Add OAuth login to package stats reporting