Always prefer supported stages in UIAA flow
Changes the way the next stage in an UIAA authentication flow is chosen. It now prefers supported stages over unsupported ones.
The first commits are documentation and refactoring. Only the last one should actually change the behavior of the authentication dialog.