An app that measures pain could help people with dementia