LIVEOAK-706: Fix encoding issues between JSON and ResourceStates, more c...

...onsistent behaviour between converting back and forth.