Bugfix, refactor and add lots of tests.

The bugfix is to never return an unknown context. Previously, the
requested context could be returned in some circumstances even though
the eduID IdP was not aware of the semantics of the requested context.

The refactoring and test cases were done to increase confidence in the
implementation of this crucial part of the IdP, as well as to prevent
future regressions of course.