Preliminary type-driven JSON deserialization

This is a small change with high impact. I tested it on just a few examples. This fixes #1267 once and for all. Make sure to look into the diff and check the `XXX` comment. We will need to pass `type` around for non-`PlotObject` instances of `HasProps` (which I think was suggested long before). This could be fixed in this PR, because there shouldn't be a clash with existing properties.