Restructure preload data into a JSON-friendly format

This allows using the same preload data both from JS and Java