modularized SSO, paving the way for potential plugins. cleaned up associated templates/js