Fixes and extra tests for Problem <-> JSON (de)serialisation