ServiceMatrix - how to change persistence storage

First PR for # 482. Restructuring will be done as a series of small pull requests.