Add helper function to convert to dynamo format, tests for that function