Implement registration and login/out.