coursera: credentials: Move lambda function to be a proper function.

This helps us with the code being self explanatory (and, of course, with
comments transformed into docstrings).
coursera: credentials: Try to make the code more explicit.

Hopefully, slightly more readable, but I doubt it. Besides, this really
belongs in the standard library, not in our code.

Windows users will probably cry if I did something stupid, but we can just
revert this, in that case.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
coursera: credentials: Convert long comment into proper documentation.