Refactor authentication commands and add support for specifiying a
server url or alias to the whoami command.