Extracted JSON client functions into seperate package

Solves #317 
Ok, changed it.