Quality of Care in Nursing Homes: The Impact of Dementia, Mental Illness, and Work Environment