Convert a nested struct into a nested map

I needed this functionality recently; thank you for writing it!

I also needed to account for lists, so I added:

defp convert(data) when is_list(data) do
  Enum.map(data, fn item ->
    convert(item)
  end)
end