Developing A Flexible System For A Friendly Robot To Ease Dementia (Fred) Using Cloud Technologies And Software Design Patterns