auth command + refactoring

Support AUTH command for clients.