Tidy and tweak json.h.

only actual functional change was that last commit where i realized the player invlet_cache wasn't being deserialized at all.

Everything else was just reshuffling and renaming for clarity, or adding template variants for completeness.