Refactor of the external logins 

Had this branch lying around for a while. The changes decouple the OAuth web security stuff from our code, and also allow the icons for the OAuth providers to be configured in the app settings.