Login controller and tests