Write out whole `system.json`

As it turns out, compiler doesn't actually write `system.json`, so we
need to write it out ourselves.