People are living longer—and they're also spending their last years in better health, according to new research.