Update after CR on PR #496

- Reorder function comments to make return values more obvious
- Use switch rather then if/else if/else
- Order auth mechanisms by their value