Extracted JSON client functions into seperate package

Closes #317 
pinned.Config doesn't implement Dialer, so it wouldn't work correctly :(