Changes for serialization

Added functionality to serialize datastore objects, changed how format
was passed, added serialize unit tests