Dev json xff v0.4

New version based on previous PR #1111.
Yes, I have been doing too much Java programming that I forget what pointers are :)