structs: Migrate from namedtuple to dataclass

This lets us do some typing for the attributes, and specify the default
values in a much more user-friendly way.
2 jobs for typing
Status Job ID Name Coverage
  Test
canceled #16424
run-test

 
  Build
canceled #16425
run-build