Rehabilitation device for hands and arms