Update JSON unmarshling.

 Thanks to @tianon for the chat and percolating ideas.