Refactoring of OneLogin into more general SAML authn code. Small bug fixes.