authenticate: refactor

Make code easier to understand.
Add comments.
Improve logging.
Make search for attribute case insensitive.
Remove unused attribute mapping.

The dashboard SP only looks at a single SAML attribute,
and does not make use of the attribute mapping anyway.
Create utility function for extracting a SAML attribute.
Add documentation.

... and re-factor logging slightly.
Add support for stripping a suffix from user_main_attribute.

Scoped EPPN might need to have the scope removed before we can look
for the user in the database.
INFO-logging of login/logout.
_set_name_id: Correct function documentation.
Fix unit tests for the eppn changes
Merge pull request #4 from SUNET/lookup_user_using_eppn

Lookup user using eppn