Improve domain modelling
- Model a lower-level "weakly-typed" metadata, which is essentially
just a JSON object.
- Model a level above this layer that translates from the
"weakly-typed" metadata into a "strongly-typed" metadata.
- Use the "weakly-typed" metadata type in all lower-level areas:
- The database/storage layer
- The server layer
- The webhook layer
- All these layers don't care much about what form the metadata is
in, and so the weak type is more appropriate here.
- Use the "strongly-typed" metadata type in the PR validator.
- This is the only area where we want the stronger types.
- Shuffle tests around accordingly, write new tests.
- Cleanup the codebase a bit.