rename mapToJSON to valToJSON
Get rid of test code
Return values with the right structure.
Update BacksidePersistence test to also test the memory store