Extracted JSON client functions into seperate package

Solves #317 
I actually had a `newClientWithDial` previously, but archSeer mentioned that it was only used once and could be removed.