Convert standard JSON into format that D3 library can use