Non-Ilkka Json serialization; a few other fixes.