Adding configuration hooks for UsePersistence<T>
Converted the inmemory persistence to the new model