Turn oauth_endpoints into a function.
Simplifies collate considerably