Extracted JSON client functions into seperate package

Closes #317 
Or maybe `newClient`