Centralize parsing of JSON files to a single struct

The codebase contains several hard-coded behaviour regarding the format of the JSON files. Examples include:

These examples are hard to find and debug, and therefore any change to the JSON format is very painful at the moment. We should have a single entrypoint where all required functionality is defined, and always use that entrypoint.