This is building on other PRs. Can be spilt out if needed.
It's possible to also add a common mediatype registry, but that wasn't done here. It could save a few bytes but is another registry to handle. The encoded format should be checked that it could support this in the future without breakage.