Added generic persistence API and generic datatypes

Change-Id: Icad8e5ba03f1bb904b60d354447353ef3ab074a0