Unit tests for DatabasePersister

This is complete and working
Updated DatabasePersister

Updated code after unit tests