Extracted JSON client functions into seperate package

Solves #317 
Ah, okay, that's fine.